/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 martyr.h

	$Header: /heroes4/martyr.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( MARTYR_H_INCLUDED )
#define MARTYR_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "bitmap_cursor.h"
#include "combat_spell_single_target.h"
#include "handler.h"
// --------------------------------------------------------------------
// handle martyr spell
// --------------------------------------------------------------------
class t_spell_martyr : public t_combat_spell_single_target
{
public:
	t_spell_martyr( t_battlefield& battlefield, t_spell spell );

	virtual bool			cast_on( t_combat_creature_ptr caster, 
		                             t_combat_creature_ptr target, 
									 int power,
									 bool is_mirror );
	virtual double          ai_weight( t_combat_creature const& target ) const;
	virtual t_combat_ai_action_list generate_combat_ai_action_list(t_combat_ai &owner);
	virtual double					get_cancel_weight( t_combat_creature const& target ) const;
	virtual t_mouse_window* mouse_move( t_screen_point const& point,
										std::string& help_text );
	virtual t_mouse_window*	get_spell_cursor() const;
	virtual bool            left_click( t_screen_point const& point );
protected:
	t_combat_creature_ptr	m_client;
	t_bitmap_cursor			m_martyr_client_cursor;
	t_bitmap_cursor			m_martyr_cursor;
	bool					m_selecting_source;
};

// --------------------------------------------------------------------
// show martyr spell in action
// --------------------------------------------------------------------
class t_martyr_action : public t_handler_base
{
public:
	t_martyr_action( t_combat_creature_ptr client, t_combat_creature_ptr creature,
		             int damage, bool permanent );
	void operator()();
protected:
	t_combat_creature_ptr m_client;
	t_combat_creature_ptr m_creature;
	int					  m_damage;
	bool				  m_permanent;
};

#endif // MARTYR_H_INCLUDED